﻿CREATE TABLE [dbo].[Accounts_Registration_Requests] (
    [User_GUID]          UNIQUEIDENTIFIER NOT NULL,
    [first_name]         VARCHAR (50)     NULL,
    [last_name]          VARCHAR (50)     NULL,
    [phone_number]       VARCHAR (30)     NULL,
    [organisation]       VARCHAR (50)     NULL,
    [email]              VARCHAR (255)    NULL,
    [passwordencrypt]    VARCHAR (255)    NULL,
    [datetimecreated]    DATETIME         NOT NULL,
    [processing_error]   BIT              CONSTRAINT [DF_Accounts_Registration_Requests_processing_error] DEFAULT ((0)) NOT NULL,
    [processing_message] VARCHAR (200)    NULL,
    CONSTRAINT [PK_Accounts_Registration_Requests] PRIMARY KEY CLUSTERED ([User_GUID] ASC),
    UNIQUE NONCLUSTERED ([User_GUID] ASC)
);


GO
CREATE NONCLUSTERED INDEX [Accounts_Registration_Requests_All_Index]
    ON [dbo].[Accounts_Registration_Requests]([first_name] ASC, [last_name] ASC, [phone_number] ASC, [organisation] ASC, [email] ASC, [datetimecreated] ASC, [processing_error] ASC);

